#include <iostream>
#include <stdlib.h>

using namespace std;

class A{
public:
    A(int k=0){i=k;}
    void display() {cout<<"i="<<i<<endl;}
private:
    int i;
};

int main()
{
    A* p=new A;
    p->display();
    delete p;

    p=new A(8);
    p->display();
    delete p;

    p=new A[3];
    A* q=p;
    for(int i=0;i<3;i++)
    {
        q++->display();
    }
    delete []p;

    system("pause");
    return 0;
}
